package com.ouran.common;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;

/**
 * 系统级别异常处理
 * @author lijiajun
 *
 */
public class CommonException implements HandlerExceptionResolver {
	@Override
	public ModelAndView resolveException(HttpServletRequest arg0,
			HttpServletResponse arg1, Object arg2, Exception arg3) {
		arg3.printStackTrace();
		ModelAndView modelAndView = new ModelAndView();
		modelAndView.addObject("message",arg3.getMessage());
		modelAndView.setViewName("error");
		return modelAndView;
	}
 
}
